<?php

//date格式化一个本地时间/日期
//格式字符串：(1)普通字符原样显示(2)特殊字符，有特定的含义
echo date("北京时间：Y年m月d日 H:i:s.v e\n");
//通过构造方法创建DateTime对象
$d = new DateTime(); //创建一个日期对象，默认值"now"表示当前的日期时间
$d = new DateTime("2000-10"); //2000-10-01 00:00:00.000000
$d = new DateTime( "2000-10-5"); //2000-10-05 00:00:00.000000
$d = new DateTime("2000-10 12:34:56"); //2000-10-01 12:34:56.000000
$d = new DateTime( "2000-10 12:34"); //2000-10-01 12:34:00.000000
$d = new DateTime( "12:34"); //今天日期的 2025-10-29 12:34:00.000000
$d = new DateTime("20001005 123456"); //2000-10-05 12:34:56.000000
$d = new DateTime( "2000/10/1 12:34:56"); //必须有日 2000-10-01 12:34:56.000000
print_r($d);
//日期的格式化输出，访问对象的属性或方法用->而不是=>
echo $d->format( "Y-m-d H:i:s.v e\n");
echo $d->format( "年：Y\n");
$a = ['name' => 'zs', 'age' => 18];